package com.wellsoft.pt.app.dingtalk.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;

import com.wellsoft.context.jdbc.support.QueryItem;
import com.wellsoft.pt.app.dingtalk.dao.MultiOrgDingDeptDao;
import com.wellsoft.pt.app.dingtalk.entity.MultiOrgDingDept;
import com.wellsoft.pt.jpa.dao.impl.AbstractJpaDaoImpl;

/**
 * Description: 钉钉部门信息dao实现类
 *  
 * @author bryanlin
 * @date 2020-05-18
 * @version 1.0
 * 
 * <pre>
 * 修改记录:
 * 修改后版本	修改人		修改日期			修改内容
 * 2020-05-18	bryanlin		2020-05-18		Create
 * </pre>
 *
 */
@Repository
public class MultiOrgDingDeptDaoImpl extends AbstractJpaDaoImpl<MultiOrgDingDept, String> implements MultiOrgDingDeptDao {

	@Override
	public QueryItem getNodeInfoByDingtalkDeptId(int deptId) {
		Map<String, Object> values = new HashMap<String, Object>();
		values.put("id", deptId);
		List<QueryItem> list = this.listQueryItemByNameSQLQuery("getNodeInfoByDingtalkDeptId", values, null);
		if(!CollectionUtils.isEmpty(list)) {
			return list.get(0);
		}
		return null;
	}

}
